Walda
Walda Pepper (Japanese: アヤノ Ayano) is a young girl in Rustboro City who is very sick. She has only appeared in . Her father bought her multiple Poké Dolls—such as and the —to cheer her up, but it has not worked. If the player is able to say something to make her laugh, her father will reward them with a new wallpaper for the Pokémon Storage System. Words that will make Walda laugh usually consist of random characters and depend on the player's Trainer ID number. Passphrase calculation There are 256 different passphrases for every possible wallpaper Walda's father can grant. The primary components that go into a passphrase are: * The player's Trainer ID (this will be referred to as tid) * An index number for the pattern of the wallpaper (pat) * An index number for the icon in the wallpaper (ico) * A value for the background color, influencing the majority of the pattern (bcolor) * A value for the foreground color, influencing the icons and specific parts of the pattern (fcolor) The final component can be any random number ranging from 0 to 255 (this will be referred to as key). Different values for this number can create vastly different passphrases, but they will all unlock the same wallpaper. This number simply masks and scrambles the other values. This section will explain the process of creating a passphrase from the required components, but the game can easily reverse this process to create the proper wallpaper from a given passphrase. Components Colors The colors are 2-byte values that represent the five highest bits of the red, green, and blue values in an RGB color in the manner shown below: :00000000 00000000 As an example, if the green color used above—represented as "99FF99" in hexadecimal or 10011001 11111111 10011001 in binary—were chosen for the wallpaper's background, it would be encoded as 01001111 11110011 (0x4FF3 or 20,467) for bcolor. Patterns and icons There are 16 different possible patterns and 30 possible icons that can be placed within the patterns. They are described below as they are named in the filb.de generator linked at the bottom of this page. A sample of each of the patterns and some of the icons may be seen here. | width="50px" | | style="vertical-align:top" | | width="50px" | | style="vertical-align:top" | |} The icons that are marked with an asterisk (*) are only available in Japanese versions of Pokémon Emerald. If this index is used in an English passphrase, no icon will appear in the resulting wallpaper. This does not apply to the Ribbon wallpaper, however; that wallpaper can be unlocked in the English version of Emerald, but it is slightly different from the Japanese version. Algorithm tid, bcolor, and fcolor are all 2-byte values. However, this algorithm deals with the bytes in these values separately. tid''1, ''bcolor''1, and ''fcolor''1 will refer to the lowest byte of these values, while ''tid''2, ''bcolor''2, and ''fcolor''2 will refer to the highest byte. For example, if the value of ''tid is 511 (00000001 11111111), then tid''1 is 255 (11111111) and ''tid''2 is 1 (00000001). The player's Trainer ID undergoes a transformation before it is used in the rest of the algorithm. :''x = bcolor''1 ⊕ ''fcolor''1 ⊕ ''ico ⊕ tid''2 :''y = bcolor''2 ⊕ ''fcolor''2 ⊕ ''pat ⊕ tid''1 A 9-byte string is then created by joining all of the current values together as follows: :''U = (bcolor''1) (''bcolor''2) (''fcolor''1) (''fcolor''2) (''ico) (pat) (x'') (''y) (key) Next, a bitmask is created using the highest four bits of key. These four bits are repeated to fill the highest 8 bytes of a 9-byte string, with the bits in the lowest byte remaining 0; this string is represented below as mask. :V'' = ''U ⊕ mask Then, the highest 8 bytes of V'' are treated as if they are a circular structure (with the lowest bit "connected" back around to the highest bit) and are shifted to the right by (''key % 16) bit positions. After this, the whole 9-bytes are treated as a circular structure and shifted right by 21 bit positions. This result will be referred to below as W''. ''W is the string that will finally be used to create the passphrase. Since a passphrase requires inputting a full-length word and the maximum length of input differs between Japanese and English games, the method of interpreting W'' to arrive at the passphrase differs between Japanese and English games. In English games, every 5 bits in ''W represent a letter in the passphrase. Since W'' is a 9-byte string (or 72 bits long), it contains enough bits for 14 full letters, with 2 bits left over. To form the last letter and reach the maximum 15-letter length for English input, the letter effectively wraps back to the top of ''W, using the two lowest bits of W'' for the letter's two highest bits and the three highest bits of ''W for the letter's three lowest bits. Letters can be determined by matching the value of each 5-bit number with a character below: This is largely the first 32 capital and lowercase English letters without vowels, with a select few other letters excluded as well. So, in an English game, if the first (highest) two bytes of W'' are 01110111 01011000, the first three letters of the passphrase will be "S" (01110, or 14), "p" (11101, or 29), and "Q" (01100, or 12). If the last (lowest) byte of ''W is also 00000001, then the last letter of the passphrase will be "P" (01011, or 11). In Japanese games, every 6 bits in W'' represent a letter in the passphrase. Since ''W is a 9-byte string (or 72 bits long), this divides W'' evenly into a maximum length, 12-letter passphrase. Letters can be determined by matching the value of each 6-bit number with a character below: This corresponds to the first 64 characters in the game's Japanese character encoding, offset by 1 to skip the space in the 0 position. So, in a Japanese game, if the first (highest) two bytes of ''W are 00001110 00011101, the first two letters of the passphrase will be "え" (000011, or 3) and "め" (100001, or 33). Note that when the original 9-byte string U'' (and then ''V) was being manipulated, the random bitmask and shifting based on key avoided the part of the string (the lowest byte) that contained key itself. The only time key is manipulated is in the final, set shift by 21 bits. Because of this, the game can know exactly how to retrieve key from a passphrase and reverse the entire algorithm to extract the wallpaper components from the passphrase. Names External links *Pokémon Emerald Secret Word Generator on filb.de Category:Game characters Category:Emerald characters Category:Female characters